home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / docs / misc / ConcNews.lha / news / amiga.compilers / comp.sys.amiga.programmer_26396_000010.msg < prev    next >
Encoding:
Text File  |  1994-11-27  |  2.5 KB  |  65 lines

  1. Path: etek.chalmers.se!chalmers.se!sunic!mcsun!Germany.EU.net!news.netmbx.de!mailgzrz.TU-Berlin.DE!math.fu-berlin.de!ira.uka.de!yale.edu!qt.cs.utexas.edu!cs.utexas.edu!usc!howland.reston.ans.net!bogus.sura.net!udel!gatech!concert!sas!mozart.unx.sas.com!walker
  2. From: walker@twix.unx.sas.com (Doug Walker)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Auto opening libraries by SAS/C
  5. Message-ID: <C2HvE1.2xL@unx.sas.com>
  6. Date: 15 Feb 93 14:39:37 GMT
  7. References: <729632360.F00001@monly.wlink.nl>
  8. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  9. Organization: SAS Institute Inc.
  10. Lines: 52
  11. Originator: walker@twix.unx.sas.com
  12. Nntp-Posting-Host: twix.unx.sas.com
  13.  
  14.  
  15. In article <729632360.F00001@monly.wlink.nl>, Bart.Schraa@f115.n100.z60.wlink.nl (Bart Schraa) writes:
  16. |> Hi,
  17. |> 
  18. |> How do I actually auto open a system library with SAS/C 6.2. I tried some things which were stated in the manual. I only should do this wouldn't I?
  19. |> 
  20. |> long oslibversion = 38L;
  21. |> 
  22. |> struct Library *DOSBase;
  23. |> 
  24. |> Then my program shouldn't run under V37, would it? I also tried the other one : 'long OSlibversion = 38L'. I linked all of these with c.o, but all attempts I did were running, but they really shouldn't.
  25. |> 
  26. |> Maybe there is someone with a solution? Doug?
  27. |> 
  28. |> Kind Regards, Bart.
  29.  
  30.  
  31. Firstly, DOSBase is a special case.  It is autoopened by the STARTUP 
  32. code, not by the autoinit code in the libraries.  The startup code
  33. doesn't look at __oslibversion.  SysBase is the only other such
  34. exception.
  35.  
  36. Secondly, NOTHING looks at oslibversion.  The non-DOSBase code
  37. looks at __oslibversion, though.  The name is extremely important!
  38.  
  39. Thirdly, remember that if you want to autoinitialize a library
  40. base, you cannot DEFINE it in your code, you can only DECLARE
  41. it in your code.  Therefore, you need to say
  42.  
  43.    extern struct Library *IntuitionBase;
  44.  
  45. rather than
  46.  
  47.    struct Library *IntuitionBase;
  48.  
  49. to tell the compiler that you want IntuitionBase to be autoinitialized.
  50.  
  51. Fourthly, the best way to initialize these library bases is to simply
  52. #include the appropriate header:
  53.  
  54.    #include <proto/intuition.h>
  55.  
  56. instead of trying to declare them in your own code.
  57.  
  58. -- 
  59.   *****
  60. =*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
  61.  *|. o.| ||                                          1200/2400/9600 Dual
  62.   | o  |//     For all you do, this bug's for you!
  63.   ====== 
  64. usenet: walker@unx.sas.com                            bix: djwalker 
  65. Any opinions expressed are mine, not those of SAS Institute, Inc.